<template>
  <!--日志管理-->
  <div class="app-container">
    <el-form class="jc_search_wrap" v-model="searchList">
      <label>登录名称</label><el-input></el-input>
      <label>登录IP</label><el-input></el-input>
      <label>日志等级</label>
      <el-select v-model="list01">
        <el-option value="所有" label="所有"></el-option>
      </el-select>
      <label>开始时间</label><el-input type="date"></el-input>
      <label>结束时间</label><el-input type="date"></el-input>
      <el-button @click="searchRows"><i class="el-icon-search"></i>查询</el-button>
    </el-form>
    <el-button-group class="jc_btn_wrap jc_btn_left">
      <el-button @click="deleteRow"><i class=""></i>删除日志</el-button>
    </el-button-group>
    <el-table :data="list" v-loading.body="listLoading" element-loading-text="拼命加载中" border fit highlight-current-row class="jc_table_wrap"  @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="80px">
      </el-table-column>
      <el-table-column label='id' v-if="false">
        <template scope="scope">
          {{scope.row.id}}
        </template>
      </el-table-column>
      <el-table-column label='登录名称'>
        <template scope="scope">
          {{scope.row.name}}
        </template>
      </el-table-column>
      <el-table-column label='登录名称'>
        <template scope="scope">
          {{scope.row.createTime}}
        </template>
      </el-table-column>
      <el-table-column label='日志等级'>
        <template scope="scope">
          {{scope.row.createTime}}
        </template>
      </el-table-column>
      <el-table-column label='日志内容'>
        <template scope="scope">
          {{scope.row.createTime}}
        </template>
      </el-table-column>
    </el-table>
    <el-pagination layout="prev, pager, next" :total="total" @current-change="changePage" :page-size="15"/>
  </div>
</template>

<script>

  import * as User from "../../api/system";

  export default {
    components: {

    },
    data() {
      return {
        searchList: {
          search_LIKE_name: ''
        },
        list: null,
        total: 0,
        create_visible: false,
        detail_visible: false,
        edit_visible: false,
        form_create: {},
        form_detail: {},
        form_edit: {},
        multipleSelection: [],
        list01: '',
      }

    },
    created() {
      this.fetchData()
    },
    methods: {
      fetchData(p=1) {
        this.listLoading = true;
        var params = this.searchList;
        params.page = p;
        User.getRoleList(params).then(data => {
          this.list = data.data.rows;
          this.total = parseInt(data.data.totalCount);
          this.listLoading = false;
        })

      },
      searchRows() {
        this.fetchData()
      },
      emptyInputs() {
        this.searchList = {
          search_LIKE_name: ''
        };
        this.fetchData()
      },
      createRow() {

      },
      submitCreateForm() {

      },
      editRow() {

      },
      submitEditForm() {

      },
      detailRow(row) {

      },
      deleteRow() {
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      },
      changePage(p) {
        this.fetchData(p)
      }
    },
    computed: {
      tableHeight() {
        const filterHeight = 28
        var tableHeight = this.getTableHeight(filterHeight)
        return tableHeight;
      }
    }
  }
</script>
